#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
using namespace std;
int main(){
	int a;
	char ch1,ch2,ch3;
	cin >> a >> ch1 >> ch2 >> ch3;
	for(int i = 0;i < a;i++){
		for(int j = 0;j < a;j++){
			if(i==j) cout << ch3;
			else if(i<j) cout << ch1;
			else cout << ch2;
		}
		cout << endl;
	}
	return 0;
}

